package org.biloxi.commands;


/**
 * Calls Listeners when a Command Event occurs, passing Listener relevant data about:
 * 	 1) which Command caused event
 *   2) Options for Command
 *   3) Result of Command
 *   4) GameState
 * 
 * @author Peter.WM.Wong@gmail.com
 *
 * @param <O> Command Options
 * @param <R> Command Result
 */
public interface CommandEventDispatcher<O,R> {
	/**
	 * Registers an CommandListener which will be called when this Event occurs.   
	 * @param listener
	 */
	public void do_(Listener<O,R> l);

	/**
	 * Registers a CommandListener with a Filter.  The Registered CommandListener
	 * will only be called if the Command's results are accepted by the Filter. 
	 * @param handler
	 * @param filter
	 */
	public void do_(Listener<O,R> handler, Filter<R> filter);
		
}
